package com.sap.mobile.maf.samples.android.mafprovisioningsample;

import android.app.TabActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabWidget;

import com.sap.maf.uicontrols.MAFUIFactory;
import com.sap.maf.uicontrols.view.MAFActionBar;

public class SampleTabActivity extends TabActivity {

	private TabHost tabHost;
	private TabWidget tabWidget;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.sampletabscreen);
		
		MAFActionBar aBar = (MAFActionBar) findViewById(R.id.mafActionBar);
		// don't allow back navigation, i.e. hide the back arrow on the action bar
		aBar.allowNavigation(false);
		
		tabHost = getTabHost();
		TabHost.TabSpec spec;

		Intent content;
		content = new Intent().setClass(this, SampleTabContent.class);

		spec = tabHost.newTabSpec("details");
		spec.setIndicator("Details").setContent(content);
		tabHost.addTab(spec);

		content = new Intent().setClass(this, SampleTabContent2.class);
		spec = tabHost.newTabSpec("Map").setIndicator("Map").setContent(content);
		tabHost.addTab(spec);
		
		content = new Intent().setClass(this, SampleTabContent3.class);
		spec = tabHost.newTabSpec("Task Data").setIndicator("Task Data").setContent(content);
		tabHost.addTab(spec);

		
		tabWidget = getTabWidget();

		MAFUIFactory.getInstance().customizeTabWidget(tabWidget);

		// set the first tab as the default one
		setDefaultTab(0);
	}
}
